//
//  UIButton+Extension.m
//  微看
//
//  Created by 吴明磊 on 15/8/16.
//  Copyright © 2015年 wuminglei. All rights reserved.
//

#import "UIButton+Extension.h"

@implementation UIButton (Extension)

+ (instancetype)buttonWithTitle:(NSString *)title andTitleColor:(UIColor *)color andFontSize:(CGFloat)fontSize andImage:(NSString *)imageName andBgImage:(NSString *)bgImageName {

    UIButton *btn = [[UIButton alloc]init];
    
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    btn.titleLabel.font = [UIFont systemFontOfSize:fontSize];
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:bgImageName] forState:UIControlStateNormal];
    
    return btn;
}

- (void)setHighlighted:(BOOL)highlighted {}
+ (instancetype)buttonWithImage:(NSString *)imageName andBgImage:(NSString *)bgImageName {

    UIButton *btn = [[UIButton alloc]init];
    
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:bgImageName] forState:UIControlStateNormal];
    
    return  btn;
}

+ (instancetype)buttonWithTitle:(NSString *)title andTitleColor:(UIColor *)color andFontSize:(CGFloat)fontSize {

    UIButton *btn = [[UIButton alloc]init];
    
    
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    btn.titleLabel.font = [UIFont systemFontOfSize:fontSize];
    
    return btn;

}
@end
